#ifndef ZIGBUSITEM_H
#define ZIGBUSITEM_H

#include <QString>

class ZigbusItem
{
private:
    int size;
    int value;

public:
    ZigbusItem();
    ZigbusItem(int value, int size);
    ZigbusItem(const ZigbusItem& other);
    virtual ~ZigbusItem() { }

    ZigbusItem& operator=(const ZigbusItem& other);
    bool equals(const ZigbusItem& other) const;

    int getSize() const { return size; }
    void setSize(int size) { this->size = size; }
    int getValue() const { return value; }
    void setValue(int value) { this->value = value; }

    virtual QString text() const { return "item("+QString::number(getSize(), 10)+", "+QString::number(getValue(),2)+"(2))"; }

    virtual QString type() const { return "item"; }

    virtual bool isValid() const { return value > -1; }
};

bool operator==(const ZigbusItem& a, const ZigbusItem& b);
bool operator!=(const ZigbusItem& a, const ZigbusItem& b);
#endif // ZIGBUSITEM_H
